package init_serve

import (
	"github.com/gin-gonic/gin"
	_ "roc/wechat/docs"
	"roc/wechat/global"
	"roc/wechat/middleware"
	"roc/wechat/routers"
)

// InitRouter 初始化路由
func InitRouter() (r *gin.Engine) {
	gin.SetMode(global.CONFIG.Serve.RunMode)

	r = gin.Default()
	r.Use(middleware.Cors())
	r.Use(middleware.Recover())

	rBase := r.Group("api/")
	routers.InitAuth(rBase)
	return
}
